package ms.unicorn.dsl.impl;


import ms.unicorn.Element;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.EAttributeImpl;
import org.eclipse.emf.ecore.impl.ENotificationImpl;

public class EPhantomAttribute extends EAttributeImpl implements ms.unicorn.EPhantomAttribute {

	private EDataType datatype;

	public EPhantomAttribute(EDataType datatype, String name) {
		this.datatype = datatype;
		this.name = name;
	}
	
	@Override
	public boolean isVisible() {
		return false;
	}

	@Override
	public String getCategory() {
		// TODO Auto-generated method stub
		return null;
	}

	public <T> T getValue(Element e) {
		return e.getProperty(datatype, name);
	}
	
	public <T> void setValue(Element e, T value) {
		Object oldValue = getValue(e);
		e.setProperty(datatype, name, value);
		e.eNotify(new ENotificationImpl((InternalEObject) e, Notification.SET, this, oldValue, getValue(e)));
	}

	@Override
	public String getDisplayName() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getDescription() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean isMultiLine() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isSortChoice() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public Object getImage() {
		// TODO Auto-generated method stub
		return null;
	}

}
